package xkp.lesson2;

import xkp.lesson1.Person;

/**
 * 员工
 * @author Administrator
 *
 */
public class Employee extends Person{
	private String jobName;
	private double salary;

	public Employee() {

	}


	public Employee(String jobName, double salary) {
		this.jobName = jobName;
		this.salary = salary;
	}


	public String getJobName() {
		getAge();
		return jobName;
	}
	public void setJobName(String jobName) {
		this.jobName = jobName;
	}
	public double getSalary() {
		return salary;
	}
	public void setSalary(double salary) {
		this.salary = salary;
	}

	//此处考虑问题：父类中有一个被public修饰的fun1()方法，父类中所有非private资源都会被子类继承。
	//此处是方法重载(方法名一样，参数一样)
	public void fun1(String str) {
		System.out.println("-----");
	}
	
	//儿子已经有一个fun1()方法，此处如果再写一个fun1()方法，岂不是方法重复？
	//注意：因为儿子原有的fun1()方法是从父类中继承而来，此处的fun1()是重写
	//重写发生在子类与父类之间，要求两个方法方法名一致，参数一致。
	public void fun1() {
		
	}

}
